<?php
$logged = init();

?>
<div class="menu_common">
  <div class="menu_button" onclick="location.href='?action=index'">
    <?= getMessageByKey("button.menu.main") ?>
  </div>

  <?php
  if ($logged) {
    ?>
    <div class="menu_button" onclick="location.href='?action=profile'" <?php
    if (hasNewTopicMessages()) {
      ?>
      style="background-color: rgba(255, 127, 036, 1);"
    <?php
    }
    ?>>
      <?= getMessageByKey("button.menu.profile") ?>
    </div>
    <div class="menu_button" onclick="location.href='?action=sections'">
      <?= getMessageByKey("button.menu.sections") ?>
    </div>
    <div class="menu_button" onclick="location.href='?action=dialogs'"
        <?php
        if (hasNewMessages()) {
          ?>
          style="background-color: rgba(255, 127, 036, 1);"
        <?php
        }
        ?>

        >
      <?= getMessageByKey("button.menu.messages") ?>
    </div>
<!--    <div class="menu_button" onclick="location.href='?action=gallery'">-->
<!--      --><?//= getMessageByKey("button.menu.gallery") ?>
<!--    </div>-->
    <div class="menu_button" onclick="location.href='?action=flies'">
      <?= getMessageByKey("button.menu.flies") ?>
    </div>
<!--    <div class="menu_button" onclick="location.href='?action=articles'">-->
<!--      --><?//= getMessageByKey("button.menu.articles") ?>
<!--    </div>-->
    <div class="menu_button" onclick="location.href='?action=info'">
      <?= getMessageByKey("button.menu.info") ?>
    </div>
    <div class="menu_button" onclick="location.href='?action=logout'">
      <?= getMessageByKey("button.menu.logout") ?>
    </div>
  <?php
  } else {
    ?>
    <div class="menu_button" onclick="location.href='?action=reg'">
      <?= getMessageByKey("button.menu.registration") ?>
    </div>
<!--    <div class="menu_button" onclick="location.href='?action=articles'">-->
<!--      --><?//= getMessageByKey("button.menu.articles") ?>
<!--    </div>-->
    <div class="menu_button" onclick="location.href='?action=info'">
      <?= getMessageByKey("button.menu.info") ?>
    </div>
    <div class="menu_button" onclick="location.href='?action=login'">
      <?= getMessageByKey("button.menu.login") ?>
    </div>
  <?php
  }
  ?>
</div>
